import java.util.Vector;

public class Node
{
	/** connections to neighbors */
	Vector<Edge> edges = new Vector<Edge>();
	String uid;
	public Node(String name)
	{
		this.uid = name;
	}
	public void addNeighbor(Node c)
	{
		edges.add(new Edge(c, this, 1));
	}
	public boolean isNeighborsWith(Node next)
	{
		for (Edge e : edges) {
			if(e.to == next)
				return true;
		}
		return false;
	}
	public void removeNeighbor(Node next)
	{
	//		for (Edge e : edges) {
			for(int i = edges.size()-1; i >= 0; --i)
			{
				Edge e = edges.get(i);
				if(e.to == next)
				{
					edges.remove(e);
				}
			}
		}
}
